// Package ioc
// Created by GoLand
// @User: lenora
// @Date: 2024/8/27
// @Time: 16:01

package ioc

import (
	intrgrpc "camp/microbook/interactive/grpc"
	"camp/microbook/pkg/grpcx"
	"github.com/spf13/viper"
	"google.golang.org/grpc"
)

func NewGrpcXServer(server *intrgrpc.InteractiveServer) *grpcx.Server {
	s := grpc.NewServer()
	server.Register(s)
	return &grpcx.Server{
		Server: s,
		Addr:   viper.GetString("grpc.server.addr"),
	}
}
